package com.kaibes.core.base.thread;

import java.util.concurrent.atomic.AtomicLong;

public abstract class TimeoutThreadImpl extends RunThreadImpl implements TimeoutThread {

    private long interval;
    private long timeOut;
    private AtomicLong lastTime = new AtomicLong(System.currentTimeMillis());
    
    public TimeoutThreadImpl(long interval, long timeOut) {
        this.interval = interval;
        this.timeOut = timeOut;
    }
    
    @Override
    public long getInterval() {
        return interval;
    }
    @Override
    public long getTimeOut() {
        return timeOut;
    }
    
    @Override
    public long getLastTime() {
        return lastTime.get();
    }
    
    @Override
    public void setLastTime(long lastTime) {
        this.lastTime.set(lastTime);
    }
    
}
